<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
    <div style="padding-left: 10px" class="row">
        <input th:value="${className}" type="hidden" id="adjustStudentClassName"/>
        <div class="col-md-4">
            <div>
                <form class="form-inline">
                    <th:block th:if="${exam.status!=null && exam.status=='未发布'}">
                        <th:block th:if="${status=='自定义'}">
                            <div class="form-group">
                                <input id="adjustStudentSearch" type="text" class="form-control"/><a th:onclick="exam.adjustStudentSearch([[${className}]])" href="javascript:void(0)" style="margin-left: 5px" class="btn btn-default">查询</a>
                            </div>
                        </th:block>
                        <th:block th:unless="${status=='自定义'}">
                            <div class="form-group">
                                <input id="adjustStudentSearch" readonly th:value="${className}" type="text" class="form-control"/>
                            </div>
                        </th:block>
                    </th:block>
                    <th:block th:if="${exam.status!=null && exam.status!='未发布'}">
                        <div class="form-group">
                            <input id="adjustStudentSearch" readonly th:value="${className}" type="text" class="form-control"/>
                        </div>
                    </th:block>

                </form>
            </div>
        </div>
    </div>
    <div class="row">
        <div id="adjustStudentContent">
            <th:block th:if="${exam.status!=null && exam.status=='未发布'}">
                <div class="col-md-6">
                    <div align="center"> <b>未关联的班级学生</b></div>
                    <table id="noneRelationTable" class="table">
                        <thead>
                        <tr>
                            <th width="15%">序号</th>
                            <th width="35%">班级名称</th>
                            <th width="50%">学生名称</th>
                        </tr>
                        </thead>
                        <tbody>
                        <th:block th:if="${noneRelationClass==null || noneRelationClass.size()==0}">
                            <tr><td colspan="3" align="center">没有查询到未关联的学生</td></tr>
                        </th:block>
                        <th:block th:if="${noneRelationClass!=null}">
                            <tr th:each="student:${noneRelationClass}" th:ondblclick="exam.adjustStudentBind([[${student.code}]])" >
                                <td th:text="${studentStat.index+1}"></td>
                                <td th:text="${student.grade+'-'+student.major+'-'+student.class_no}"></td>
                                <td th:text="${student.sname}"></td>
                            </tr>
                        </th:block>
                        </tbody>
                    </table>
                </div>
                <div class="col-md-6">
                    <div align="center">  <b>已关联的班级学生</b></div>
                    <table id="relationTable" class="table">
                        <thead>
                        <tr>
                            <th width="15%">序号</th>
                            <th width="35%">班级名称</th>
                            <th width="50%">学生名称</th>
                        </tr>
                        </thead>
                        <tbody>
                        <th:block th:if="${relationClass==null || relationClass.size()==0}">
                            <tr><td colspan="3" align="center">没有查询到已关联的学生</td></tr>
                        </th:block>
                        <th:block th:if="${relationClass!=null}">
                            <tr th:each="student:${relationClass}" th:ondblclick=" exam.adjustStudentUnBind([[${student.code}]])">
                                <td th:text="${studentStat.index+1}"></td>
                                <td th:text="${student.grade+'-'+student.major+'-'+student.class_no}"></td>
                                <td th:text="${student.sname}"></td>
                            </tr>
                        </th:block>
                        </tbody>
                    </table>
                </div>
            </th:block>
            <th:block th:if="${exam.status!=null && exam.status!='未发布'}">
                <div class="col-md-12">
                    <table id="relationTable" class="table">
                        <thead>
                        <tr>
                            <th width="15%">序号</th>
                            <th width="35%">班级名称</th>
                            <th width="50%">学生名称</th>
                        </tr>
                        </thead>
                        <tbody>
                        <th:block th:if="${relationClass==null || relationClass.size()==0}">
                            <tr><td colspan="3" align="center">没有查询到已关联的学生</td></tr>
                        </th:block>
                        <th:block th:if="${relationClass!=null}">
                            <tr th:each="student:${relationClass}">
                                <td th:text="${studentStat.index+1}"></td>
                                <td th:text="${student.grade+'-'+student.major+'-'+student.class_no}"></td>
                                <td th:text="${student.sname}"></td>
                            </tr>
                        </th:block>
                        </tbody>
                    </table>
                </div>
            </th:block>
        </div>

    </div>
</html>